package cn.web.web_module.controller;

import cn.itcast.pojo.order;
import cn.itcast.util.ResponseEntity;
import cn.web.web_module.service.OrderAddressFindService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: 张松
 * @Description:
 * @Date: Created in 17:28 2020/8/4
 * @Modified By:
 */
@RestController
@RequestMapping("OrderAddressFindController")
public class OrderAddressFindController {

        @Resource
        private OrderAddressFindService orderAddressFindService;


        @GetMapping("findOrderAddress")
        public ResponseEntity findOrderAddress(String address){
            List<order> orderAddress = orderAddressFindService.findOrderAddress(address);
            if (!orderAddress.isEmpty()||orderAddress.size()>0){
                return new ResponseEntity(orderAddress);
            }
            return new ResponseEntity().error_300();
        }

}
